home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1293 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Variable paramater list macros
  5. Date: 12 Jan 1996 21:03:03 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Jan12140303@qcd.lanl.gov>
  8. References: <4crc3v$hm8@barnacle.iol.ie> <TANMOY.96Jan8085718@qcd.lanl.gov>
  9.     <JARNOT.96Jan11165456@box10.dstar.iddis.com>
  10. NNTP-Posting-Host: qcd.lanl.gov
  11. Mime-Version: 1.0
  12. Content-Type: text
  13. In-reply-to: jarnot@iddis.com's message of 11 Jan 1996 21:54:56 GMT
  14.  
  15. --text follows this line--
  16. In article <JARNOT.96Jan11165456@box10.dstar.iddis.com>
  17. jarnot@iddis.com (Kevin J. Jarnot) writes: 
  18. <snip>
  19.        Derek> I want to replace a variable
  20.        Derek> argument list function (which I use for debugging ) with a
  21.        Derek> macro that does nothing.
  22.        Derek>    Unfortunately I can't remember how to write a macro
  23.        Derek> that takes a variable number of paramaters ! Can you ?
  24.  
  25.        Tanmoy> The question has no answer within the C
  26.        Tanmoy> language. Individual compilers may provide a way. Please
  27.        Tanmoy> ask in a system/compiler specific group.
  28.        Tanmoy> The FAQ has a little to say about this.
  29.  
  30.  
  31.    Actually, this is not 100% true.  I use the following macro for debugging
  32.    all the time:
  33.  
  34.    #if defined(DEBUG)
  35.    #define DPRINTF(args) (dprintf args)    // Only print when DEBUG is declared
  36.    #else
  37.    #define DPRINTF(args)                   // O/w, the code won't even
  38. be there! 
  39.    #endif
  40.  
  41. Yes, that is the reason why I referred to the FAQ. I said `a little'
  42. because this needs a change in the calling convention from single to
  43. double parens.
  44.  
  45. Cheers
  46. Tanmoy
  47. --
  48. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  49. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  50. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  51. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  52. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  53. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  54.